package com.iot.device.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.iot.device.mapper.PressureSensorEventMapper;
import com.iot.device.domain.PressureSensorEvent;
import com.iot.device.service.IPressureSensorEventService;

/**
 * 压力传感器事件Service业务层处理
 * 
 * @author iot
 * @date 2023-06-30
 */
@Service
public class PressureSensorEventServiceImpl implements IPressureSensorEventService 
{
    @Autowired
    private PressureSensorEventMapper pressureSensorEventMapper;

    /**
     * 查询压力传感器事件
     * 
     * @param id 压力传感器事件主键
     * @return 压力传感器事件
     */
    @Override
    public PressureSensorEvent selectPressureSensorEventById(Long id)
    {
        return pressureSensorEventMapper.selectPressureSensorEventById(id);
    }

    /**
     * 查询压力传感器事件列表
     * 
     * @param pressureSensorEvent 压力传感器事件
     * @return 压力传感器事件
     */
    @Override
    public List<PressureSensorEvent> selectPressureSensorEventList(PressureSensorEvent pressureSensorEvent)
    {
        return pressureSensorEventMapper.selectPressureSensorEventList(pressureSensorEvent);
    }

    /**
     * 新增压力传感器事件
     * 
     * @param pressureSensorEvent 压力传感器事件
     * @return 结果
     */
    @Override
    public int insertPressureSensorEvent(PressureSensorEvent pressureSensorEvent)
    {
        return pressureSensorEventMapper.insertPressureSensorEvent(pressureSensorEvent);
    }

    /**
     * 修改压力传感器事件
     * 
     * @param pressureSensorEvent 压力传感器事件
     * @return 结果
     */
    @Override
    public int updatePressureSensorEvent(PressureSensorEvent pressureSensorEvent)
    {
        return pressureSensorEventMapper.updatePressureSensorEvent(pressureSensorEvent);
    }

    /**
     * 批量删除压力传感器事件
     * 
     * @param ids 需要删除的压力传感器事件主键
     * @return 结果
     */
    @Override
    public int deletePressureSensorEventByIds(Long[] ids)
    {
        return pressureSensorEventMapper.deletePressureSensorEventByIds(ids);
    }

    /**
     * 删除压力传感器事件信息
     * 
     * @param id 压力传感器事件主键
     * @return 结果
     */
    @Override
    public int deletePressureSensorEventById(Long id)
    {
        return pressureSensorEventMapper.deletePressureSensorEventById(id);
    }

    @Override
    public List<Map<String, Long>> selectPressureSensorEventRankByClient(Long userId, long limit) {
        return pressureSensorEventMapper.selectPressureSensorEventRankByClient(userId, limit);
    }

    @Override
    public List<PressureSensorEvent> selectRecentPressureSensorEventList(Long userId, long limit) {
        return pressureSensorEventMapper.selectRecentPressureSensorEventList(userId, limit);
    }
}
